//
//  GamePrefectureViewController.m
//  GameBoss
//
//  Created by dllo on 15/4/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "GamePrefectureViewController.h"
#import "MoreViewController.h"
@interface GamePrefectureViewController ()
@property (nonatomic, retain)NSMutableArray *gamePreArr;
@property (nonatomic, retain) UITableView *tableView;
@end

@implementation GamePrefectureViewController
- (void)dealloc
{
    [_gamePreArr release];
    [_tableView release];
    [super dealloc];
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.gamePreArr = [NSMutableArray arrayWithObjects: @"DNF",@"LOL", @"梦幻西游",@"桃园",@"剑灵",@"九阴真经",@"三国杀",@"魔兽世界",@"暗黑3",@"坦克世界",nil];
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Screen.width, Screen.height)];
    imageView.image = [UIImage imageNamed:@"daoheng"];
    [self.view addSubview:imageView];
    [imageView release];
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, Screen.width, Screen.height - 64) style:(UITableViewStylePlain)];
    self.tableView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:self.tableView];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    [_tableView release];
    
#pragma mark 夜间判断
//    if ([NightMode shareNightMode].isNight) {
//        [[NightMode shareNightMode] loadNightModeInfoFormDisk];
//    }
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *reuse = @"reuse";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse];
    if (!cell) {
        cell =[[[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleValue1) reuseIdentifier:reuse] autorelease];
    }
    cell.textLabel.text = self.gamePreArr[indexPath.row];
    cell.textLabel.textColor = [UIColor whiteColor];
    cell.backgroundColor = [UIColor clearColor];
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60 * Screen.height / 667;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    MoreViewController *moreVC = [[MoreViewController alloc] init];
    moreVC.title = self.gamePreArr[indexPath.row];
    NSString *str = [NSString stringWithFormat:@"%ld", (long)indexPath.row+120];
    moreVC.num = str;
    [self.navigationController pushViewController:moreVC animated:YES];
    [moreVC release];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark 选取白黑两种模式
- (void)setNightDayModel {
    [NightManager setViewColorWithView:self.tableView];
    //    [NightManager setLabelColorWithLabel:self.title];
    
}

- (void)setLightDayModel {
    [NightManager setViewColorWithView:self.tableView];
    //    [NightManager setLabelColorWithLabel:self.title];
    
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
